<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>面向对象之构造函数继承</title>
</head>
<body>

<script>
    //call（）方法，能实现在子类构造函数中执行父类构造函数中的语句
    //但是每个对象有对应的一套东西，不能实现
    //比类式继承牛逼的地方是：子类可以向父类传递参数啦
    function Shape(b) {
        this.bian = b;
        this.shuxing = ['name','mianji'];
    }
    Shape.prototype.getArea = function () {
        return this.shuxing;
    }

    function Triangle(tt) {
        Shape.call(this,tt);
    }
//    Triangle.prototype = new Shape();
    var rightTriangle = new Triangle("right");
    var equilTriangle = new Triangle("equil");
    console.log(rightTriangle.bian);
    console.log(equilTriangle.bian);
    console.log(rightTriangle.bian);
    console.log(rightTriangle.getArea());

    //单纯的构造函数继承是不能使用父类的原型链上的方法的
</script>
</body>
</html>